package com.zhuanzhuan.hero.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhuanzhuan.hero.user.entity.HeroLabelInfo;
import com.zhuanzhuan.hero.user.pojo.po.LabelRelateNumPO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * dal Interface:HeroLabelInfo
 * @author hanjunjun
 * @date 2024-6-21
 */
public interface HeroLabelInfoMapper extends BaseMapper<HeroLabelInfo> {

    List<HeroLabelInfo> selectAll();

    List<HeroLabelInfo> select(HeroLabelInfo record);

    Integer getCount(HeroLabelInfo record);

    Integer insertSelective(HeroLabelInfo record);

    /**
     * 查询标签  用户自己创建的和运营创建的
     *
     * @param uid
     * @param labelType
     * @param createrRole 运营角色的code
     * @return java.util.List<com.zhuanzhuan.hero.user.entity.HeroLabelInfo>
     * @author  hanjunjun
     * @date 2024/7/3
     **/
    List<HeroLabelInfo> queryUserAllLabels(@Param("uid") Long uid, @Param("labelType") Integer labelType,
        @Param("createrRole") Integer createrRole);

    /**
     * 根据labelId更新relatedNum
     *
     * @param labelId
     * @param increRelatedNum
     * @return void
     * @author  hanjunjun
     * @date 2024/7/19
     **/
    void increRelatedNum(Long labelId, int increRelatedNum);

    /**
     * 查询标签的关联数
     *
     * @param labelIds
     * @param states
     * @return java.util.List<com.zhuanzhuan.hero.user.pojo.po.LabelRelateNumPO>
     * @author  hanjunjun
     * @date 2024/7/23
     **/
    List<LabelRelateNumPO> queryLabelsRelatedNum(@Param("labelIds") List<Long> labelIds, @Param("states") List<Integer> states);
}